<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <h1>遍历对象</h1>
    <div v-for="value,key,index in person" :key="key">
      key--->{{key}}--->value--->{{value}}--->index--->{{index}}
    </div>

    <h1>遍历string</h1>
    <div v-for="item,index in message" :key="index">
      item-->{{item}}--->index--->{{index}}
    </div>

    <h1>遍历number</h1>
    <div v-for="item,index in 10" :key="item">
      item-->{{item}}--->index--->{{index}}
    </div>
  </div>
  <script>
    Vue.config.productionTip = false;

    const vm = new Vue({
      el: "#app",
      data() {
        return {
          person: {
            name: "xiaowang",
            age: 18,
            sex: "男",
          },
          message: "hello every one",
        };
      },
    });
  </script>
</body>

</html>